<!DOCTYPE html 
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Eliminar Evento del Calendario</title>
    <style>
    li {
      border-bottom: solid black 1px;      
      margin: 10px; 
      padding: 2px; 
      width: auto;
      padding-bottom: 20px;
    }
    h2 {
      color: red; 
      text-decoration: none;  
    }
    span.attr {
      font-weight: bolder;  
    }
	.Estilo4 {
	color: #990000;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 2;
	font-weight: bold;
}
.Estilo8 {
	color: #000000;
	font-family: Verdana, Arial, Helvetica, sans-serif;

}
.Estilo5 {
	color: #000000;
	font-size: 14px;
}
.Estilo6 {color: #FF0000}
.Estilo7 {color: #FF0000; }
}
    li {
      border-bottom: solid black 1px;      
      margin: 10px; 
      padding: 2px; 
      width: auto;
      padding-bottom: 20px;
    }
    h2 {
      color: red; 
      text-decoration: none;  
    }
    span.attr {
      font-weight: bolder;  
    }
    </style>    
  </head>
  <body>
    <?php
    // load classes
    require_once 'Zend/Loader.php';
    Zend_Loader::loadClass('Zend_Gdata');
    Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
    Zend_Loader::loadClass('Zend_Gdata_Calendar');
    Zend_Loader::loadClass('Zend_Http_Client');
    
    // connect to service
    $gcal = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
    $user = "urbalbertoravell@gmail.com";
    $pass = "albertoravell001";
    $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $gcal);
    $gcal = new Zend_Gdata_Calendar($client);
      
    // if event ID is present
    // get event object from feed
    // delete event  
    if (isset($_GET['id'])) {
      try {          
          $event = $gcal->getCalendarEventEntry('http://www.google.com/calendar/feeds/default/private/full/' . $_GET['id']);
          $event->delete();
      } catch (Zend_Gdata_App_Exception $e) {
          echo "Error de sistema, chequee el proceso: " . $e->getResponse();
		  echo "<meta http-equiv='refresh' content='1; url=../Eventos/view.php' />"; 
      } 
	  ?>
<TABLE height=500 cellSpacing=3 cellPadding=0 width=549 align=center bgColor=#ffffff border=0 bordercolor="#ff0000">
<tr>
<td vAlign=top width=543  height=490 bgColor=#ff0000>
	<TABLE height=500 cellSpacing=1 width=541  border=0>
        <TBODY>
        <TR>
          <TD vAlign=top bgColor=#ffffff width="537">            
          <DIV>
          	<DIV>
            <p>&nbsp;</p>
            <DIV align=center class="Estilo4">
              <p class="Estilo5">Eliminar Evento</p>
              <p class="Estilo5">&nbsp;</p>
              <p class="Estilo5 Estilo6">_________________________________________________</p>
           </DIV>  
              <table align="center">
                <tr>
                    <td>
                        <img src="../IMAGENES-PROYECTO/eliminar.png"></a>
                    </td>
                </tr> 
               </table>
			</DIV>
          </TD>
          </TR>
          </TBODY>
          </TABLE>
    </td>
    </tr>
  </TABLE>
      <?php
	  echo "<meta http-equiv='refresh' content='1; url=../Eventos/view.php' />";  
       
    } else {
      echo 'No se Encontro Evento';  
    }
    ?>
  </body>
</html>
